package com.bnz.controller;

import com.bnz.service.impl.SysDetailService;
import com.bnz.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xy
 * @date 2022/10/27
 */

@RestController
public class UserController {
    @Autowired
    SysDetailService sysDetailService;

   @RequestMapping("/success")
    public String success(){
        ;
        return "登录成功";
    }
    @PreAuthorize("hasRole('supply:find')")
    @RequestMapping("/supply/find")
    public String supplyfind(){
       return "/supply/fin访问成功";
    }

    @PreAuthorize("hasRole('supply:add')")
    @RequestMapping("/supply/add")
    public String supplyadd(){
        return "/supply/add访问成功";
    }

    @PreAuthorize("hasRole('supply:del')")
    @RequestMapping("/supply/del")
    public String supplydel(){
        return "/supply/del访问成功";
    }

    @PreAuthorize("hasRole('supply:updete')")
    @RequestMapping("/supply/update")
    public String supplyupdate(){
        return "/supply/update访问成功";
    }

    @PreAuthorize("hasRole('purchase:find')")
    @RequestMapping("/purchase/find")
    public String purchasefind(){
        return "/purchase/find访问成功";
    }

    @PreAuthorize("hasRole('purchase:add')")
    @RequestMapping("/purchase/add")
    public String purchaseadd(){
        return "/purchase/find访问成功";
    }

    @PreAuthorize("hasRole('purchase:del')")
    @RequestMapping("/purchase/del")
    public String purchasedel(){
        return "/purchase/del访问成功";
    }

    @PreAuthorize("hasRole('consignment:find')")
    @RequestMapping("/consignment/find")
    public String consignmentfind(){
        return "/consignment/find访问成功";
    }

    @PreAuthorize("hasRole('consignment:add')")
    @RequestMapping("/consignment/add")
    public String consignmentadd(){
        return "consignment/add";
    }
    @PreAuthorize("hasRole('consignment:del')")
    @RequestMapping("/consignment/del")
    public String consignmentdel(){
        return "consignment/del";
    }

}
